
<!DOCTYPE html>
<html>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>凯络科技后台管理系统 - 添加/编辑用户</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

     <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
	<link href="__PUBLIC__/css/page.css" rel="stylesheet">
    <link href="__PUBLIC__/css/new.css" rel="stylesheet">
	<script src="__PUBLIC__/js/jquery.min63b9.js?v=2.1.4"></script>
    <script src="__PUBLIC__/js/plugins/layer/layer.min.js"></script>
    
   
	
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <if condition=" !empty($orderinfo)"> 
                           <h5>客户编辑</h5>
                        <else/>
                           <h5></h5>
                        </if>
                        
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal m-t" id="commentForm" action="{:U('customer_edit')}" method="post">
							<input type='hidden' name="id" id='id' value='<if condition=" !empty($orderinfo)"> {$orderinfo.id} </if>' />
                            <input type='hidden' name="jumpurl" id='jumpurl' value='<if condition=" !empty($jumpurl)"> {$jumpurl} </if>' />
                            
                            <div class="form-group">
                               <label class="col-sm-1 control-label">销售数据</label>
                               
                               <div class="col-sm-9">
                               
                                      <div class="form-group">
                                            <label class="col-sm-2 control-label">订单号：</label>
                                            <div class="col-sm-3">
                                            	<if condition=" $user_type eq 2 ">
                                                 <input id="tid" name="tid" minlength="" type="text" class="form-control input-sm" required aria-required="true" placeholder='' autocomplete="off"  value='<if condition=" !empty($orderinfo)"> {$orderinfo.tid} </if>'>
                                                 <else />
                                                 <input readonly  id="tid" name="tid" minlength="" type="text" class="form-control input-sm" required aria-required="true" placeholder='' autocomplete="off"  value='<if condition=" !empty($orderinfo)"> {$orderinfo.oid} </if>'>
                                                 </if>
                                            </div>
                                        </div>
                                        
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">姓名：</label>
                                            <div class="col-sm-10">
                                            	<if condition=" $user_type eq 2 ">
                                                <input  id="receiver_name" name="receiver_name" minlength="" type="text" class="form-control input-sm width200 inline" required aria-required="true" placeholder='' autocomplete="off" {$customerinfo?"":""} onfocus="this.type='text'" value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_name} </if>'>
                                                <else />
                                                <input readonly  id="receiver_name" name="receiver_name" minlength="" type="text" class="form-control input-sm  width200 inline" required aria-required="true" placeholder='' autocomplete="off" {$customerinfo?"":""} onfocus="this.type='text'" value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_name} </if>'>
                                                </if>
                                                 &nbsp 电话：
                                                 <if condition=" $user_type eq 2 ">
                                                 <input  id="receiver_mobile" type="receiver_mobile" class="form-control input-sm width200 inline" name="receiver_mobile"  placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_mobile} </if>'>
                                                  <else />
                                                <input readonly   id="receiver_mobile" type="receiver_mobile" class="form-control input-sm width200 inline" name="receiver_mobile"  placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_mobile} </if>'>
                                                </if>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">地址：</label>
                                            <div class="col-sm-9">
                                            	<if condition=" $user_type eq 2 ">
                                                <input id="receiver_address" type="receiver_address" class="form-control input-sm" name="receiver_address" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_address} </if>'>
                                                <else />
                                                <input readonly  id="receiver_address" type="receiver_address" class="form-control input-sm"  name="receiver_address" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.receiver_address} </if>'>
                                                </if>
                                            </div>
                                        </div>
                                        <foreach name='orderinfo.orders' item='order'> 
                                           <div class="form-group">
                                            <label class="col-sm-2 control-label"><if condition="$key eq 0">产品：</if></label> 
                                            <div class="col-sm-10">
                                              <if condition=" $user_type eq 2 ">
                                                 <input  type='text' class='form-control input-sm width600 inline' name="outer_iid[{$order.id}]" value='<if condition=" !empty($order)"> {$order.outer_iid} </if>'>
                                                 &nbsp
                                                 数量：
                                                 <input  type='text' class='form-control input-sm width100 inline' name="num[{$order.id}]" value='<if condition=" !empty($order)"> {$order.num} </if>'>
                                                 &nbsp
                                                 价格：
                                                 <input  type='text' class='form-control input-sm width100 inline'  name="price[{$order.id}]" value='<if condition=" !empty($order)"> {$order.price} </if>'>
                                                
                                              <else />
                                                 <input readonly type='text' class='form-control input-sm width600 inline' name="outer_iid[{$order.id}]" value='<if condition=" !empty($order)"> {$order.outer_iid} </if>'>
                                                 &nbsp
                                                 数量：
                                                 <input readonly type='text' class='form-control input-sm width100 inline' name="num[{$order.id}]" value='<if condition=" !empty($order)"> {$order.num} </if>'>
                                                 &nbsp
                                                 价格：
                                                 <input readonly type='text' class='form-control input-sm width100 inline'  name="price[{$order.id}]" value='<if condition=" !empty($order)"> {$order.price} </if>'>
                                              </if>
                                            </div>
                                        </div>
                                        </foreach>
                                        
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">订购时间：</label>
                                            <div class="col-sm-3">
                                             <if condition=" $user_type eq 2 ">
                                                <input  id="created" type="" class="form-control input-sm" name="created" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.created} </if>'>
                                             <else />
                                                <input readonly  id="created" type="" class="form-control input-sm" name="created" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.created} </if>'>
                                            </if>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">销售平台：</label>
                                            <div class="col-sm-3">
                                            <if condition=" $user_type eq 2 ">
                                                 <input  id="shop" type="" class="form-control input-sm" name="shop" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.shop} </if>'>
                                             <else />
                                            	<input  readonly id="shop" type="" class="form-control input-sm" name="shop" placeholder='' value='<if condition=" !empty($orderinfo)"> {$orderinfo.shop} </if>'>
                                            </if>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">备注：</label>
                                            <div class="col-sm-6">
                                           <if condition=" $user_type eq 2 ">
                                                <textarea   class='form-control input-sm' name='seller_memo'><if condition=" !empty($orderinfo)"> {$orderinfo.seller_memo} </if></textarea>
                                             <else />
                                            	<textarea readonly   class='form-input' name='seller_memo'><if condition=" !empty($orderinfo)"> {$orderinfo.seller_memo} </if></textarea>
                                            </if>
                                                
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">
                                                <input  type="radio" name="express" value="ems" <?php echo ($customerinfo['express']=='ems')?'checked':'' ?> >邮政
                                                <input  type="radio" name="express" value="shunfeng" <?php echo ($customerinfo['express']=='shunfeng')?'checked':'' ?> >顺风
                                                <input  type="radio" name="express" value="yuantong" <?php echo ($customerinfo['express']=='yuantong')?'checked':'' ?> >圆通 
                                                <input  type="radio" name="express" value="shentong" <?php echo ($customerinfo['express']=='shentong')?'checked':'' ?> >申通  
                                                <input  type="radio" name="express" value="kuaijie" <?php echo ($customerinfo['express']=='kuaijie')?'checked':'' ?> >快捷   
                                            </label>
                                            <div class="col-sm-8">
                                            <if condition=" $user_type eq 2 ">
                                                <input type='text' class='form-control input-sm width200 inline' name='invoice_no' value='<if condition=" !empty($orderinfo)"> {$orderinfo.invoice_no} </if>' >
                                             <else />
                                            	<input readonly  type='text' class='form-control input-sm width200 inline' name='invoice_no' value='<if condition=" !empty($orderinfo)"> {$orderinfo.invoice_no} </if>' >
                                            </if>单号 &nbsp &nbsp
                                            <if condition=" $user_type eq 2 ">
                                                <input  type='text' class='form-control input-sm width200 inline' name='expressfee' value='<if condition=" !empty($customerinfo)"> {$orderinfo.post_fee} </if>'>
                                             <else />
                                            	<input  readonly type='text' class='form-control input-sm width200 inline' name='expressfee' value='<if condition=" !empty($customerinfo)"> {$orderinfo.post_fee} </if>'>
                                            </if>快递费
                                            </div>
                                        </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                               <label class="col-sm-1 control-label">退款管理</label>
                               
                               <div class="col-sm-9">
                                   <div class="form-group">
                                        <label class="col-sm-2 control-label">数量：</label>
                                        <div class="col-sm-10">
                                        <if condition=" $user_type eq 2 ">
                                           <input type='text' class='form-control input-sm width100 inline' name='refund_num' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_num} </if>'>
                                         <else />
                                            <input readonly type='text' class='form-control input-sm width100 inline' name='refund_num' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_num} </if>'>
                                        </if>
                                           
                                           &nbsp 金额： 
                                           <if condition=" $user_type eq 2 ">
                                           <input type='text' class='form-control input-sm width100 inline' name='refund_fee' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_fee} </if>'>
                                            <else />
                                            <input readonly type='text' class='form-control input-sm width100 inline' name='refund_fee' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_fee} </if>'>
                                       		 </if>
                                        
                                           &nbsp 特殊退款赔付：
                                        <if condition=" $user_type eq 2 ">
                                           <input type='text' class='form-control input-sm width100 inline' name='refund_payment' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_payment} </if>'>
                                         <else />
                                           <input readonly type='text' class='form-control input-sm width100 inline'  name='refund_payment' value='<if condition=" !empty($orderinfo)"> {$orderinfo.refund_payment} </if>'>
                                       	</if>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">操作人：</label>
                                        <div class="col-sm-10">
                                         <if condition=" $user_type eq 2 ">
                                           <input type="text"  name='refund_operator' class='form-control input-sm width150 inline' value="<?php echo empty($orderinfo['refund_operator'])?$_SESSION['user']['username']:$orderinfo['refund_operator']; ?>">
                                         <else />
                                           <input readonly type="text" readonly  name='refund_operator' class='form-control input-sm width150 inline' value="<?php echo empty($orderinfo['refund_operator'])?$_SESSION['user']['username']:$orderinfo['refund_operator']; ?>">
                                       	</if>
                                             
                                           
                                           &nbsp  
                                           <if condition=" $user_type eq 2 ">
                                           <select name='refund_shop' class='form-control input-sm width150 inline'>
                                           <else />
                                            <select  onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;" name='refund_shop' class='form-control input-sm width150 inline'>
                                           </if>
                                              <if condition=" $shop_list ">
                                                <foreach name='shop_list' item='shop'>
                                                    <option "<?php echo $orderinfo['shop']==$shop['shop_name']?'selected':'' ?>" >{$shop.shop_name}</option>
                                                </foreach>
                                              </if>
                                           </select> 
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">退款备注：</label>
                                        <div class="col-sm-6">
                                            <textarea  class='form-control input-sm' name='refund_remarks' style='width:500px'><if condition=" !empty($orderinfo)"> {$orderinfo.refund_remarks} </if></textarea>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">客服：</label>
                                        <div class="col-sm-3">
                                     
                                           <select name='service' class='form-control input-sm' style='padding-top:0px'>
										   
                                               <option value=''>客服</option >
                                              <if condition=" $service_list ">
                                                <foreach name='service_list' item='service'>
                                                    <option <?php echo  $orderinfo['service']== $service['id']?"selected='true'":'' ?> value='{$service.id}'>{$service.name}</option>
                                                </foreach>
                                              </if>
                                           </select> 
                                        </div>
                                    </div>
                            
                               </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                	<input type="submit" value='提交'  class="btn btn-primary"  />
                                   <!--<span class="btn btn-primary" id='submit'>提交</span>-->
                                   <input type='reset' class="btn btn-primary">
                                   <if condition=" !empty($orderinfo)"> 
                                    <a class="btn btn-primary" href='javascript:history.back(-1)'>返回</a>
                                   </if>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__PUBLIC__/js/jquery.min63b9.js?v=2.1.4"></script>
	<script src="__PUBLIC__/js/bootstrap.min14ed.js?v=3.3.6"></script>
    <script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>
    <script src="__PUBLIC__/js/content.mine209.js?v=1.0.0"></script>
    <script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
    <script src="__PUBLIC__/js/demo/peity-demo.min.js"></script>
    
    <script src="__PUBLIC__/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__PUBLIC__/js/plugins/jquery.tablesort.min.js"></script>
   

<script>
    $('#submit').click(function(event){
		 event.preventDefault();
		 event.stopPropagation();
		
		 var id=$('#id').val();
		 var username=$('#username').val();
		 var password=$('#password').val();
		 var email=$('#cemail').val();
		 var phone=$('#phone').val();
		 
		 user_error=$('#username-error').text();
		 pw_error=$('#password-error').text();
		 email_error=$('#cemail-error').text();
		 
		 info="{$res4}";
		 if(username=='')
		 {   
			 return false;
		 }
		 if(user_error!='' || pw_error!='' || email_error!='')
		 {
			 return false;
		 }
		 if(info=='' && password=='')
		 {
			 return false;
		 }
		 
		 $.ajax({
			 //url: '{:U("Admin/admin_add")}',
			 url: '/index.php/home/index/user_update',
			 type:'POST',
			 data:'id='+id+'&username='+username+'&password='+password+'&email='+email+'&phone='+phone,
			 success:function(data){
				if(data==0){
					layer.alert('新增失败','',function(){location.href='user_list'});
				}else if(data==1){
					layer.alert('新增成功','',function(){location.href='user_list'});
				}else if(data==2){
				
					layer.alert('修改成功','',function(){self.location=document.referrer;});
				}else if(data==3){
					console.log($data);return false;
					layer.alert('修改失败','',function(){self.location=document.referrer;});
				}else if(data==4){
					layer.alert('该用户名已存在');
				}
			}
		 })
	})
</script>

</body>
<!--Made By kailuosoft.com, TEL 171 9992 9517 -->
<script  type="text/javascript"  src="http://g.tbcdn.cn/sj/securesdk/0.0.3/securesdk_v2.js"  id="J_secure_sdk_v2" data-appkey="23416550"></script>
</html>
